<?php
	
	session_start();
	// pour pouvoir inclure nos classes
	include_once('class/autoload.php');
	
	
	if (isset($_SESSION['validuser'])) 
		{
			include("connexion_base.php");
			$id_connexion = connexion();
			if ($id_connexion->connect_errno ==0) 
			{
				$requete = "SELECT nomU, prenomU, adresseU, cpU, villeU, telU, pseudo, passe FROM utilisateur";
				$resultat = $id_connexion->query($requete);
				$ligne=$resultat->fetch_object();
				$nom=$ligne->nomU;
				$prenom=$ligne->prenomU;
				$adresse=$ligne->adresseU;
				$cp=$ligne->cpU;
				$ville=$ligne->villeU;
				$tel=$ligne->telU;
				$pseudo=$ligne->pseudo;
				$passe=$ligne->passe;
	
	$site = new page_base('accueil');
	$site->corps = '
	
<div class="content">


				<form method="POST" action="action_modif.php">
				<fieldset>
				<legend>Effectuez vos modifications</legend>
				<table>
				<tr><td>Nom :<input type="text" name="nom" required autofocus style="margin-left: 27px;" value="'.$nom.'"><br></td>
				<td>Prénom :<input type="text" name="prenom" required autofocus style="margin-left: 10px;" value="'.$prenom.'"><br></td></tr>
				<tr><td>Adresse :<input type="text" name="adresse" style="margin-left: 4px;" required value="'.$adresse.'"><br></td>
				<td>CP :<input type="text" name="cp" required autofocus style="margin-left: 41px;" value="'.$cp.'"><br></td></tr>
				<tr><td>Ville :<input type="text" name="ville" required autofocus style="margin-left: 32px;" value="'.$ville.'"><br></td>
				<td>Tel :<input type="text" name="tel" required autofocus style="margin-left: 42px;" value="'.$tel.'"><br></td></tr>
				<tr><td>Pseudo :<input type="text" name="pseudo" required autofocus style="margin-left: 8px;" value="'.$pseudo.'"><br></td>
				<td>Passe :<input type="text" name="passe" required autofocus style="margin-left: 20px;" value="'.$passe.'"><br></td></tr>
				</table>
				</fieldset>
				<br>
				<input type="submit" value="Modifier">
				</form>
	
</div>
	</div>
  <p>&nbsp;</p>

		
	</div>';
	}
	}
	$site->affiche();
?>



	<!-- javascript at the bottom for fast page loading -->
  <script type="text/javascript" src="js/jquery.js"></script>
  <script type="text/javascript" src="js/jquery.easing-sooper.js"></script>
  <script type="text/javascript" src="js/jquery.sooperfish.js"></script>
  <script type="text/javascript" src="js/jquery.kwicks-1.5.1.js"></script>
  <script type="text/javascript">
    $(document).ready(function() {
      $('#images').kwicks({
        max : 600,
        spacing : 2
      });
      $('ul.sf-menu').sooperfish();
    });
  </script>
</body>
</html>